<template>
    <div>
        <Modal v-model="modal.search" title="高级搜索" width="1020">
            <Form ref="searchForm" :model="searchForm" :label-width="120">
                <Row>
	<i-col span="12">
	<FormItem label="数据字典项编号"><Row>
	<i-col span="11">
	<FormItem prop="idMin">
	<InputNumber v-model="searchForm.idMin" placeholder="请输入开始数据字典项编号" style="width: 100%;"/>
</FormItem>
</i-col>
	<i-col span="2" style="text-align: center">-</i-col>
	<i-col span="11">
	<FormItem prop="idMax">
	<InputNumber v-model="searchForm.idMax" placeholder="请输入结束数据字典项编号" style="width: 100%;"/>
</FormItem>
</i-col>
</Row>
</FormItem>
</i-col><i-col span="12">
	<FormItem label="数据字典编号"><Row>
	<i-col span="11">
	<FormItem prop="dictIdMin">
	<InputNumber v-model="searchForm.dictIdMin" placeholder="请输入开始数据字典编号" style="width: 100%;"/>
</FormItem>
</i-col>
	<i-col span="2" style="text-align: center">-</i-col>
	<i-col span="11">
	<FormItem prop="dictIdMax">
	<InputNumber v-model="searchForm.dictIdMax" placeholder="请输入结束数据字典编号" style="width: 100%;"/>
</FormItem>
</i-col>
</Row>
</FormItem>
</i-col>

	<i-col span="12">
	<FormItem label="数据字典项值"><Row>
	<i-col span="11">
	<FormItem prop="dictValueMin">
	<InputNumber v-model="searchForm.dictValueMin" placeholder="请输入开始数据字典项值" style="width: 100%;"/>
</FormItem>
</i-col>
	<i-col span="2" style="text-align: center">-</i-col>
	<i-col span="11">
	<FormItem prop="dictValueMax">
	<InputNumber v-model="searchForm.dictValueMax" placeholder="请输入结束数据字典项值" style="width: 100%;"/>
</FormItem>
</i-col>
</Row>
</FormItem>
</i-col><i-col span="12">
	<FormItem label="数据字典项显示值" prop="dictDisplayValue">
	<Input v-model="searchForm.dictDisplayValue" placeholder="请输入数据字典项显示值" clearable/>
</FormItem>
</i-col>

	<i-col span="12">
	<FormItem label="数据字典项排序"><Row>
	<i-col span="11">
	<FormItem prop="dictOrderMin">
	<InputNumber v-model="searchForm.dictOrderMin" placeholder="请输入开始数据字典项排序" style="width: 100%;"/>
</FormItem>
</i-col>
	<i-col span="2" style="text-align: center">-</i-col>
	<i-col span="11">
	<FormItem prop="dictOrderMax">
	<InputNumber v-model="searchForm.dictOrderMax" placeholder="请输入结束数据字典项排序" style="width: 100%;"/>
</FormItem>
</i-col>
</Row>
</FormItem>
</i-col><i-col span="12">
	<FormItem label="显示颜色" prop="color">
	<Input v-model="searchForm.color" placeholder="请输入显示颜色" clearable/>
</FormItem>
</i-col>

	<i-col span="12">
	<FormItem label="是否默认值" prop="isDefault">
	    
	        <Select v-model="searchForm.isDefault" placeholder="是否默认值" filterable clearable>
	          <Option
	            v-for="(option, index) in isDefaultSelect"
	            :value="option.value"
	            :key="index"
	          >{{option.displayValue}}</Option>
	        </Select>
	    
	</FormItem>
</i-col><i-col span="12">
	<FormItem label="描述" prop="description">
	<Input v-model="searchForm.description" placeholder="请输入描述" clearable/>
</FormItem>
</i-col>

	<i-col span="12">
	<FormItem label="版本号"><Row>
	<i-col span="11">
	<FormItem prop="versionMin">
	<InputNumber v-model="searchForm.versionMin" placeholder="请输入开始版本号" style="width: 100%;"/>
</FormItem>
</i-col>
	<i-col span="2" style="text-align: center">-</i-col>
	<i-col span="11">
	<FormItem prop="versionMax">
	<InputNumber v-model="searchForm.versionMax" placeholder="请输入结束版本号" style="width: 100%;"/>
</FormItem>
</i-col>
</Row>
</FormItem>
</i-col><i-col span="12">
	<FormItem label="创建时间"><Row>
	<i-col span="11">
	<FormItem prop="createTimeMin">
	<DatePicker @on-change="searchForm.createTimeMin=$event" :value="searchForm.createTimeMin" placeholder="请输入开始创建时间" type="datetime" format="yyyy-MM-dd HH:mm:ss" style="width: 100%;" clearable></DatePicker>
</FormItem>
</i-col>
	<i-col span="2" style="text-align: center">-</i-col>
	<i-col span="11">
	<FormItem prop="createTimeMax">
	<DatePicker @on-change="searchForm.createTimeMax=$event" :value="searchForm.createTimeMax" placeholder="请输入结束创建时间" type="datetime" format="yyyy-MM-dd HH:mm:ss" style="width: 100%;" clearable></DatePicker>
</FormItem>
</i-col>
</Row>
</FormItem>
</i-col>

	<i-col span="12">
	<FormItem label="更新时间"><Row>
	<i-col span="11">
	<FormItem prop="updateTimeMin">
	<DatePicker @on-change="searchForm.updateTimeMin=$event" :value="searchForm.updateTimeMin" placeholder="请输入开始更新时间" type="datetime" format="yyyy-MM-dd HH:mm:ss" style="width: 100%;" clearable></DatePicker>
</FormItem>
</i-col>
	<i-col span="2" style="text-align: center">-</i-col>
	<i-col span="11">
	<FormItem prop="updateTimeMax">
	<DatePicker @on-change="searchForm.updateTimeMax=$event" :value="searchForm.updateTimeMax" placeholder="请输入结束更新时间" type="datetime" format="yyyy-MM-dd HH:mm:ss" style="width: 100%;" clearable></DatePicker>
</FormItem>
</i-col>
</Row>
</FormItem>
</i-col><i-col span="12">
	<FormItem label="是否激活" prop="isActive">
	
		<Select v-model="searchForm.isActive" placeholder="是否激活" filterable clearable>
		  <Option
			v-for="(option, index) in isActiveSelect"
			:value="option.value"
			:key="index"
		  >{{option.displayValue}}</Option>
		</Select>
	
	</FormItem>
</i-col>
</Row>

            </Form>
            <div slot="footer">
                <Button type="text" size="large" @click="resetForm">清空</Button>
                <Button type="text" size="large" @click="cancelModal">取消</Button>
                <Button type="primary" size="large" @click="searchOkModal" :loading="loading.search">查询</Button>
            </div>
        </Modal>
    </div>
</template>

<script>
	import * as utils from '@/api/utils-v2'
	import * as ResponseStatus from '@/api/response-status'
    export default {
        name: 'DataDictItemSearch',
        data() {
            return {
                modal: {
                    search: false
                },
                loading: {
                    search: false
                },
                urls: {
                    searchUrl: '/data-dict-item/admin/pager-cond'
                },
				dataDictCodes: ['IS_ACTIVE','DATA_DICT_IS_DEFAULT'],
				dataDictItems: {},
				isActiveSelect:[],
				isDefaultSelect:[],
                searchForm: {
                    pageNo: 1,
                    pageSize: 10,
                    sortColumn: null,
                    sortOrder: null,
                    id: null,
idMin: null, 
idMax: null, 
dictId: null,
dictIdMin: null, 
dictIdMax: null, 
dictValue: null,
dictValueMin: null, 
dictValueMax: null, 
dictDisplayValue: null,
dictOrder: null,
dictOrderMin: null, 
dictOrderMax: null, 
color: null,
isDefault: null,
isDefaultMin: null, 
isDefaultMax: null, 
description: null,
version: null,
versionMin: null, 
versionMax: null, 
createTime: null,
createTimeMin: null, 
createTimeMax: null, 
updateTime: null,
updateTimeMin: null, 
updateTimeMax: null, 
isActive: null,
isActiveMin: null, 
isActiveMax: null, 

                }
            }
        },
        computed: {},
        mounted() {
			utils.getDataDict(this.dataDictCodes).then(response => {
			  if (response) {
			    this.dataDictItems = response
			    utils.getSelectDictItems(this, 'IS_ACTIVE', 'isActive', 'isActiveSelect')
				utils.getSelectDictItems(this, 'DATA_DICT_IS_DEFAULT', 'isDefault', 'isDefaultSelect')
			  }
			}).catch(error => {
			  console.log(error)
			})
		},
        methods: {
            resetForm() {
                this.$refs.searchForm.resetFields()
            },
            cancelModal(modal) {
                this.modal.search = false
            },
            searchOkModal(modal) {
                this.modal.search = false
                this.$emit('searchTable', true)
            }
        }
    }
</script>

<style>
</style>
